<?php $this->load->view('common/head');?>
<form class="form-horizontal" name="add" id="add" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post">
  <input type="hidden" name="id" id="id" value="<?=isset($rentData) ? $rentData['id'] : ''?>">
  <input type="hidden" name="procId" id="procId" value="<?=$procId?>">
  <input type="hidden" name="projectId" id="projectId" value="<?=$projectId?>">
  <table class="table table-condensed table-bordered mb27" style="width: 380px; margin:0 auto;">
    <tbody>
      <tr>
        <td class="bg-primary col-md-4">场租单价</td>
        <td>
          <input type="number" required min="0" step="0.01" class="form-control" name="unitPrice" id="unitPrice" value="<?=(float)$rentData['unitPrice'] ? $rentData['unitPrice'] : ''?>" placeholder="场租单价">
        </td>
      </tr>
      <tr>
        <td class="bg-primary col-md-4">场租面积(㎡)</td>
        <td>
        <input type="number" required min="0" step="0.01" class="form-control" name="areaSize" id="areaSize" value="<?=(float)$rentData['areaSize'] ? $rentData['areaSize'] : ''?>" placeholder="场租面积">
        </td>
      </tr>
      <tr class="<?=$_GET['id']?'':'dn'?>">
        <td class="bg-primary col-md-4">场租总额</td>
        <td>
        <input type="input" class="form-control" name="budgetApply" id="budgetApply" value="<?=(float)$rentData['budgetApply'] ? $rentData['budgetApply'] : ''?>" readonly disabled placeholder="场租总额">
        </td>
      </tr>
      <tr>
        <td class="bg-primary col-md-4">参展专营店数量(不含启辰店)</td>
        <td>
        <input type="number" required min="1" class="form-control" name="storeNum" id="storeNum" value="<?=(float)$rentData['storeNum'] ? $rentData['storeNum'] : ''?>" placeholder="参展专营店数量">
        </td>
      </tr>
      <tr class="<?=$_GET['id']?'':'dn'?>">
        <td class="bg-primary col-md-4">单个专营店场租出资上限</td>
        <td>
        <input type="input" class="form-control" name="oneStorePrice" id="oneStorePrice" value="<?=(float)$rentData['oneStorePrice'] ? $rentData['oneStorePrice'] : ''?>" readonly disabled placeholder="单个专营店场租出资上限">
        </td>
      </tr>
      <tr class="<?=$_GET['id']?'':'dn'?>">
        <td class="bg-primary col-md-4">专营店出资总额</td>
        <td>
        <input type="input" class="form-control" name="budgetStoreTotal" id="budgetStoreTotal" value="<?=(float)$rentData['budgetStoreTotal'] ? $rentData['budgetStoreTotal'] : ''?>" readonly disabled placeholder="专营店出资总额">
        </td>
      </tr>
      <tr>
        <td class="bg-primary col-md-4">启辰店出资总额</td>
        <td>
        <select required class="form-control" placeholder=".col-xs-4" id="budgetQiTotalType" name="budgetQiTotalType">
        <option value="">请选择</option>
        </select>
        </td>
      </tr>
      <tr>
        <td class="bg-primary col-md-4"></td>
        <td>
        <input type="input" class="form-control" name="budgetQiTotal" id="budgetQiTotal" value="<?=(float)$rentData['budgetQiTotal'] ? $rentData['budgetQiTotal'] : ''?>" placeholder="启辰店出资总额">
        </td>
      </tr>
      <tr class="<?=$_GET['id']?'':'dn'?>">
        <td class="bg-primary col-md-4">RMP支持场租费用</td>
        <td>
        <input type="input" class="form-control" name="budgetRmpSupport" id="budgetRmpSupport" value="<?=(float)$rentData['budgetRmpSupport']?>" readonly disabled placeholder="RMP支持场租费用">
        </td>
      </tr>
      <tr>
        <td colspan="2" align="center">
        <button type="submit" class="btn btn-default btn-primary">保存</button>
        <button type="button" onclick="closeWindow()" class="btn btn-default btn-primary">取消</button>
        </td>
      </tr>
    </tbody>
  </table>
</form>
<script type="text/javascript" src="public/js/commonCarshow.js"></script>
<script type="text/javascript">
$(function(){
  initValidation();
  loadCarshowQiTotalType('budgetQiTotalType',<?=isset($rentData['budgetQiTotalType']) ? $rentData['budgetQiTotalType'] : 0?>);
  qiTotalTypeDisplay('budgetQiTotal',<?=isset($rentData['budgetQiTotalType']) ? $rentData['budgetQiTotalType'] : 0?>);
  $("#budgetQiTotalType").change(function(){
    qiTotalTypeDisplay('budgetQiTotal',this.value);
    initValidation();
  });
});
//初始化验证
function initValidation(){
  $('form[name="add"]').find("input,select,textarea").jqBootstrapValidation("destroy");
  $('form[name="add"]').find("input,select,textarea").not("[type=submit]").jqBootstrapValidation({
      preventSubmit:false,
      submitSuccess: function (form, event) {
           event.preventDefault();
           ajaxFormSubmit('add');
       },
       submitError: function (form, event, errors) {
         event.preventDefault();
         }
    });
}
</script>
<?php $this->load->view('common/foot');?>